package upm.pb4agent.team8;

import upm.pb4agent.common.Constant;
import upm.pb4agent.team8.Common.PB4Utils;
import jade.core.AID;
import jade.core.Agent;
import jade.core.behaviours.SimpleBehaviour;
import jade.wrapper.AgentContainer;
import jade.wrapper.AgentController;

public class AgPlatform8 extends Agent
{
	protected void setup()
	{
		addBehaviour(new PlatformCreation(this));
	}
	
	class PlatformCreation extends SimpleBehaviour 
	{
		private static final long serialVersionUID = -9025183395021937196L;
		private Agent _agent;
		public PlatformCreation(Agent agent)
		{
			super(agent);
			_agent=agent;
		}

		@Override
		public void action() 
		{
			String regDeskClass = "upm.pb4agent.common.RegistrationDesk";
			String refereeClass = "upm.pb4agent.common.Referee";			

			PB4Utils.TryCreateAgent(_agent, regDeskClass, Constant.REGISTRATION_DESK, null);
			PB4Utils.TryCreateAgent(_agent, refereeClass, Constant.REFEREE, null);
		}

		@Override
		public boolean done() {
			return true;
		}
	}
}
